package com.example.ren.template;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.zhy.http.okhttp.callback.GenericsCallback;
import com.zhy.http.okhttp.callback.IGenericsSerializator;

import greendao.User;
import network.JsonGenericsSerializator;
import network.NetWork;
import network.NetWorkApi;
import okhttp3.Call;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        NetWorkApi.getUser(this,new GenericsCallback<User>(new JsonGenericsSerializator()){
            @Override
            public void onError(Call call, Exception e, int id) {
                Log.e("e",call.toString());
            }

            @Override
            public void onResponse(User response, int id) {
                Log.e("e",response.toString());
            }
        });
    }
}
